#define _CRT_SECURE_NO_WARNINGS 1



#include<stdio.h>
#include<string.h>


int main()
{
	char a[100] = { 0 }, b[100] = { 0 }, temp = 0;
	int i = 0, len = 0, j = 0;
	scanf("%s %s", a, b);
	if (strstr(a, b) != NULL)
	{
		printf("true\n");
		return 0;
	}
	len = strlen(a);
	for (i = 0; i < len - 1; i++)
	{
		temp = a[0];
		for (j = 0; j < len; j++)
		{
			a[j] = a[j + 1];
		}
		a[len - 1] = temp;
		if (strstr(a, b) != NULL)
		{
			printf("true\n");
			return 0;
		}
	}
	printf("false\n");

	return 0;
}